<?php

namespace app\api\controller;

use app\common\lib\Param;
use app\common\lib\Show;
use app\common\lib\Str;
use app\Request;
use think\facade\Cache;
use think\response\Json;

class Post extends ApiBase
{
    /**
     * 获取驿站列表
     * @return Json
     */
    public function list(): Json
    {
        $page=$this->request->get('page');
        $limit=$this->request->get('limit');
        $list = (new \app\common\business\Post())->getListByWhere([],$page,$limit);
        return Show::success($list);
    }
    /**
     * 获取驿站详情
     * @return Json
     */
    public function detail(): Json
    {
        $id=$this->request->get('id');
        if(empty($id)){
            return Show::error([],'参数错误');
        }
        $info = (new \app\common\business\Post())->getNormalById($id);
        return Show::success($info);
    }
}
